package com.xingchen.loveparttimejob.model.pojo;

import java.sql.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author lwj
 * @date 2024-12-03
 * @vesion 1.0.0
 */
public class User {
    /**
     * 用户编号
     */
    private int uId;
    /**
     * 登录用户名
     */
    private String username;
    /**
     * 加密的密码
     */
    private String password;
    /**
     * 用户头像
     */
    private String headImage;

    /**
     * 昵称
     */
    private String nickName;
    /**
     * 用户权限
     */
    private int role;
    /**
     * 在线状态
     */
    private int onlineStatus;
    /**
     * 用户状态
     */
    private int status;
    /**
     * 登录 IP 地址
     */
    private String ipAddress;
    /**
     * 连接会员表
     */
    private int vip;
    /**
     * 职位发布限制
     */
    private int maxNumberPositions;
    /**
     * 注册时间
     */
    private Date createTime;
    /**
     * 是否删除
     */
    private int state;
    /**
     * 最后修改的时间
     */
    private Date updatedAt;

    // 构造方法
    public User() {}
    public User(int uId, String username, String password, String headImage, String nickName, int role, int onlineStatus, int status, String ip_address, int vip, int max_number_positions, Date create_time, int state, Date updated_at) {
        this.uId = uId;
        this.username = username;
        this.password = password;
        this.headImage = headImage;
        this.nickName = nickName;
        this.role = role;
        this.onlineStatus = onlineStatus;
        this.status = status;
        this.ipAddress = ip_address;
        this.vip = vip;
        this.maxNumberPositions = max_number_positions;
        this.createTime = create_time;
        this.state = state;
        this.updatedAt = updated_at;
    }

    /**
     * 反射中使用到
     * @return
     */
    public Map<String,String> getMapping(){
        Map<String,String> map = new HashMap<>();
        map.put("uId","u_id");
        map.put("username","username");
        map.put("password","password");
        map.put("headImage","head_image");
        map.put("nickName","nick_name");
        map.put("role","role");
        map.put("onlineStatus","online_status");
        map.put("status","status");
        map.put("vip","vip");
        map.put("ipAddress","ip_address");
        map.put("maxNumberPositions","max_number_positions");
        map.put("createTime","create_time");
        map.put("state","state");
        map.put("updatedAt","updated_at");
        return map;
    }

    // 属性
    public int getuId() {
        return uId;
    }

    public void setuId(int uId) {
        this.uId = uId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getHeadImage() {
        return headImage;
    }

    public void setHeadImage(String headImage) {
        this.headImage = headImage;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public int getRole() {
        return role;
    }

    public void setRole(int role) {
        this.role = role;
    }

    public int getOnlineStatus() {
        return onlineStatus;
    }

    public void setOnlineStatus(int onlineStatus) {
        this.onlineStatus = onlineStatus;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ip_address) {
        this.ipAddress = ip_address;
    }

    public int getVip() {
        return vip;
    }

    public void setVip(int vip) {
        this.vip = vip;
    }

    public int getMaxNumberPositions() {
        return maxNumberPositions;
    }

    public void setMaxNumberPositions(int max_number_positions) {
        this.maxNumberPositions = max_number_positions;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date create_time) {
        this.createTime = create_time;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updated_at) {
        this.updatedAt = updated_at;
    }

    /**
     * 打印用户信息
     * @return
     */
    @Override
    public String toString() {
        return "User{" +
                "uId=" + uId +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", headImage='" + headImage + '\'' +
                ", nickName='" + nickName + '\'' +
                ", role=" + role +
                ", onlineStatus=" + onlineStatus +
                ", status=" + status +
                ", ipAddress='" + ipAddress + '\'' +
                ", vip=" + vip +
                ", maxNumberPositions=" + maxNumberPositions +
                ", createTime=" + createTime +
                ", state=" + state +
                ", updatedAt=" + updatedAt +
                '}';
    }
}
